<script setup lang="ts">
import { LMarker, LPolyline } from "@vue-leaflet/vue-leaflet";
import { useMapStore } from "@/store";

const mapStore = useMapStore();
const { pointDevideLine } = storeToRefs(mapStore);

watchEffect(() => {
  if (pointDevideLine.value) {
    mapStore.setAddedPipePoint(pointDevideLine.value.point);
  }
});
</script>

<template v-if="1 > 2">
  <LMarker v-if="pointDevideLine" :latLng="pointDevideLine.point" />
  <LPolyline
    v-for="positions in pointDevideLine?.lines"
    :key="positions"
    :lat-lngs="positions"
    color="green"
    weight="4"
  />
</template>

<style scoped lang="scss"></style>
